package com.lagou.service.impl;

import com.lagou.dao.StudentDao;
import com.lagou.entity.Student;
import com.lagou.service.StudentService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StudentServiceImpl implements StudentService {

    private Logger logger = LoggerFactory.getLogger(StudentServiceImpl.class);

    @Autowired
    private StudentDao studentDao;

    @Override
    public boolean save(Student student) {
        return studentDao.save(student) > 0;
    }

    @Override
    public boolean update(Student student) {
        return studentDao.update(student) > 0;
    }

    @Override
    public boolean delete(int id) {
        return studentDao.delete(id) > 0;
    }

    @Override
    public Student select(int id) {
        return studentDao.select(id);
    }

    @Override
    public List<Student> selectAll() {
        return studentDao.selectAll();
    }

}
